package com.university.report.cmn.service.impl;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.university.report.cmn.service.ImpRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.text.SimpleDateFormat;
import java.util.List;

/**
 * @ClassName health_report
 * @Author Jinondo
 * @Date 2021/6/20 22:11
 */
@Service
public class ImpRegionSerivceImpl implements ImpRegionService {
    @Autowired
    RedisTemplate redisTemplate3;

    @Override
    public List<List<String>> getImpRegionToday() {
        String format = new SimpleDateFormat("yyyy-MM-dd").format(new Date(System.currentTimeMillis()));
        String string = (String) redisTemplate3.opsForValue().get("ImportantRegion:" + format);
        List importantRegions = JSON.parseObject(string, List.class);
        return importantRegions;
    }
}
